﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace Dota2WebAPI
{
    [Serializable()]
    public class MatchHistory
    {

        private int dotaPrivacy;

        public int DotaPrivacyLevel
        {
            get { return dotaPrivacy; }
            set { this.dotaPrivacy = value; }
        }

        [XmlArray("matches")]
        [XmlArrayItem("match", typeof(MatchInfo))]
        public ObservableCollection<MatchDetails> Items = new ObservableCollection<MatchDetails>();

        public MatchHistory(MatchDetails[] matches)
        {
            Items = new ObservableCollection<MatchDetails>(matches);
        }

        public MatchHistory()
        {
 
        }

        public void Add(MatchDetails match)
        {
            try
            {
                Items.Add(match);
            }
            catch
            {
                throw;
            }
        }
    }
}
